<script>

</script>

<?php // for translation
__('Userstatus',true); 
__('Groupstatus',true);
__('Membership',true);
__('Committeetodo',true);
__('Meeting -Invited',true);
__('Meeting -Attended',true);
__('Attendance -Invited',true);
__('Minute -Draft mode',true);
__('Minute -Approved mode',true);
__('Decision -Assigned',true);
__('Decision -Accepted',true);
__('Item -Involve',true);
__('Userstatus -Own',true);
__('Groupstatus -Own',true);

?>
<div class="wfmodels index">
<p class='contentmenu'>[ <?php
    echo $html->link(__("Add new role",true),array('committee_id'=>$dcommittee['Committee']['id'],'controller'=>'roles','action'=>'add'));
?> ]</p>
 <?php echo $this->element('searchbox',array('from'=>$this->params['controller'].'/'.$this->params['action']));?>
<h2><?php __('Permissions');?></h2>
<?php 
if(isset($wfmodels)){
    echo $form->create('Wfmodel',array('url'=>array('controller'=>'wfmodels','action'=>'update','committee'=>$this->params['pass'][0],'role'=>$cursearch_role)));
?>
<table cellpadding="0" cellspacing="0">
<tr>
    <th width='3%'><?php __('No');?></th>
    <th>&nbsp;</th>
    <th colspan='4'><?php __('Permission');?></th>
</tr>
<tr class='header'>
    <th>&nbsp;</th>
    <th>&nbsp;</th>
    <th><?php __('Create')?></th>
    <th><?php __('View')?></th>
    <th><?php __('Edit')?></th>
    <th><?php __('Delete')?></th>
</tr>
<?php

$i = 0;
foreach ($wfmodels as $wkey=>$wfmodel):
    $class = null;
if ($i++ % 2 == 0) {
    $class = ' class="altrow"';
}
?>
    <tr<?php echo $class;?>>
        <td>
            <?php echo $i.'. '; ?>
        </td>
        <td>
            <?php echo str_replace(array('Item',__('Item',true)),(__($dcommittee['Committee']['item_name'],true))?__($dcommittee['Committee']['item_name'],true):__('Project',true),__($wkey,true)); ?>
        </td>
        <td>
            <?php if(isset($wfmodel['Create'])){ echo '<center>'.$form->input($wkey.'.Create',array('type'=>'checkbox','label'=>false,'checked'=>!empty($wfmodel['Create']),'value'=>1)).'</center>';}else{echo "&nbsp;";} ?>
        </td>
        <td>
            <?php if(isset($wfmodel['View'])) {echo '<center>'.$form->input($wkey.'.View',array('type'=>'checkbox','label'=>false,'checked'=>!empty($wfmodel['View']),'value'=>1)).'</center>'; }else{echo "&nbsp;";} ?>
        </td>
        <td>
            <?php if(isset($wfmodel['Edit'])){ echo '<center>'.$form->input($wkey.'.Edit',array('type'=>'checkbox','label'=>false,'checked'=>!empty($wfmodel['Edit']),'value'=>1)).'</center>'; }else{echo "&nbsp;";} ?>
        </td>
        <td>
            <?php if(isset($wfmodel['Delete'])){ echo '<center>'.$form->input($wkey.'.Delete',array('type'=>'checkbox','label'=>false,'checked'=>!empty($wfmodel['Delete']),'value'=>1)).'</center>'; }else{echo "&nbsp;";} ?>
        </td>
    </tr>
<?php endforeach; ?>

</table>
<?php 
echo '<br/>';
 echo $html->div('',$form->button(__('Save', true), array('type'=>'submit')).'&nbsp;'.$form->button(__('Cancel', true), array('type'=>'button', 'onclick'=>'history.go(-1)')));
 echo $form->end();?>
 <?php }?>
</div>
